package pers.cj.pdos.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import pers.cj.pdos.entity.Custom;
import pers.cj.pdos.entity.Provider;
import pers.cj.pdos.vo.CountVo;
import pers.cj.pdos.vo.CustomVo;
import pers.cj.pdos.vo.ProviderVo;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author chenj
 * @since 2019-12-12
 */
public interface ProviderMapper extends BaseMapper<Provider> {
    List<ProviderVo> listVoForInit(@Param("companyId") String companyId,
                                   @Param("page") Integer page,
                                   @Param("limit") Integer limit,
                                   @Param("search") String search);

    Long countForInit(@Param("companyId") String companyId, @Param("search") String search);

    List<ProviderVo> listVo(@Param("companyId") String companyId,
                            @Param("page") Integer page,
                            @Param("limit") Integer limit,
                            @Param("status") Integer status,
                            @Param("search") String search,
                            @Param("providerTypeId") String providerTypeId,
                            @Param("no") String no,
                            @Param("name") String name,
                            @Param("unitTel") String unitTel,
                            @Param("phone") String phone,
                            @Param("contacts") String contacts,
                            @Param("remark") String remark,
                            @Param("storeId") String storeId);

    Long count(@Param("companyId") String companyId,
               @Param("status") Integer status,
               @Param("search") String search,
               @Param("providerTypeId") String providerTypeId,
               @Param("no") String no,
               @Param("name") String name,
               @Param("unitTel") String unitTel,
               @Param("phone") String phone,
               @Param("contacts") String contacts,
               @Param("remark") String remark,
               @Param("storeId") String storeId);

    void batchChangeType(@Param("providerTypeId") String providerTypeId, @Param("list") List<Provider> list);

    List<CountVo> checkList(@Param("list") List<Provider> list);

    void deleteBatch(@Param("list")List<Provider> list);

    void insertBatch(@Param("list") List<Provider> list);

    List<ProviderVo> listVoByIds(@Param("ids")List<String> ids);
}
